﻿using System.Runtime.Serialization;
using BigData.DataContracts.Objects.BigData.BaseTypes;
using MongoDB.Bson;
using System.Collections.Generic;
using System;
using MongoDB.Bson.Serialization.Attributes;

namespace BigData.DataContracts.Objects.BigData
{
    /// <summary>
    /// Represents an object which can be represented by the timeline located in the BigData project.
    /// This represents the elements in the events collection
    /// Most properties are used for the timeline http://timeline.verite.co/
    /// </summary>
    [DataContract]
    public class Event : BigDataDBObject_FiniteLife
    {
        /// <summary>
        /// The title for this event
        /// </summary>
        [DataMember]
        public string Headline { get; set; }
        /// <summary>
        /// A description of the event
        /// </summary>
        [DataMember]
        public string Text { get; set; }
        /// <summary>
        /// Represents the media associated with this event
        /// </summary>
        [DataMember]
        public EventMedia Media { get; set; }
        /// <summary>
        /// A foreign key which references the primary key of the BigData collection from which this object
        /// came from. (Example: this would be the Id field of the object in the BigDataFourSquareCollection that
        /// this event represents
        /// </summary>
        [DataMember]
        public ObjectId RegisteredCollectionObjectId { get; set; }
        /// <summary>
        /// A foreign key which references the primary key of the BigData.RegisteredCollection collection
        /// which the data was pulled from
        /// </summary>
        [DataMember]
        public ObjectId RegisteredCollectionId { get; set; }
        /// <summary>
        /// A list of foreign keys which reference the users in the BigData.BigDataUser collection
        /// </summary>
        [DataMember]
        public List<ObjectId> AffiliatedUserIds { get; set; }
        /// <summary>
        /// When the event started
        /// </summary>
        [DataMember]
        [BsonDateTimeOptions(Kind = DateTimeKind.Utc)]
        public DateTime StartDate { get; set; }
        /// <summary>
        /// When the event completed
        /// </summary>
        [DataMember]
        [BsonDateTimeOptions(Kind = DateTimeKind.Utc)]
        public DateTime EndDate { get; set; }
    }
}
